import requests
from common.address import hostName, apiRegister
from common.vars import publicHeaders

def register_post(userName, phoneNumber):
    urlRegister = hostName + apiRegister
    headers = publicHeaders
    uploadsRegister = {
        "userName": userName,
        "password": "123456",
        "phoneNumber": phoneNumber,
        "sex": True
    }
    resObj = requests.post(url=urlRegister, headers=headers, json=uploadsRegister)
    return resObj

# PyCharm编译器的快捷键：main 回车
if __name__ == '__main__':
    # 测试代码写在这里
    resObj = register_post(userName='德云测80_13120250919', phoneNumber='13120250919')
    print(resObj.status_code)
    print(resObj.headers)
    print(resObj.text)